load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "regions",
    srcs = [
        "cached_db_regions.go",
        "db_regions.go",
        "region_provider.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/regions",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/roachpb",
        "//pkg/server/serverpb",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/catalog/lease",
        "//pkg/util/hlc",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "regions_test",
    srcs = ["region_provider_test.go"],
    deps = [
        ":regions",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/roachpb",
        "//pkg/server/serverpb",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catsessiondata",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/catalog/lease",
        "//pkg/sql/types",
        "//pkg/util/hlc",
        "//pkg/util/log",
        "//pkg/util/timeutil",
        "@com_github_stretchr_testify//require",
    ],
)
